<?php

/**
 * The Fifteen game control template
 *
 * @version    $Id: FifteenControl.phtml 204 2009-02-02 18:27:51Z david@grudl.com $
 *
 * @param  int       $width
 * @param  bool      $useAjax
 * @param  array     $order
 * @param  Presenter $presenter
 * @param  Control   $control
 * @param  Template  $template
 */
?>
{snippet}

<table>
{for $y = $width - 1; $y >= 0; $y--}
<tr>
	{for $x = $width - 1; $x >= 0; $x--}
	<td>

	{if $clickable = $control->isClickable($x, $y)}
	<a href="{link Click, $x, $y}" {if $useAjax}onclick="return !nette.action(this)"{/if}>
	{/if}

	<img src="{$baseUri}images/game{!$order[$x + $y * $width]}.jpg" width="100" height="100" alt="{!$order[$x + $y * $width]+1}" />

	{if $clickable}</a>{/if}

	</td>
	{/for}
</tr>
{/for}
</table>

{/snippet}
